/*
 * MenuBar.java  0.4.0 / Oct 26, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.swing;

import com.cute4j.swing.layouts.LayoutManager;

/**
 * Menu Bar Component.
 *
 * @cute4j.native
 *    generate="header"
 *
 * @author Slobodan Vrkacevic
 * @version 0.4.0
 */
public class MenuBar extends Container {

// Public Constructors. --------------------------------------------------------

  /**
   * Constructs new StatusBar object.
   */
  public MenuBar() {
    super(null);
  }

// Public Methods. -------------------------------------------------------------

  /**
   * Adds new menu.
   *
   * @param menu the menu to be added
   *
   * @return the menu argument
   */
  public Menu add(Menu menu) {
    super.add(menu);
    return menu;
  }

  /**
   * Adds new menu.
   *
   * @param menu the menu to be added
   * @param index the menu index
   *
   * @return the menu argument
   */
  public Menu add(Menu menu, int index) {
    super.add(menu, index);
    return menu;
  }


  /**
   * Adds separator.
   *
   * @return separator
   */
  public Separator addSeparator() {
    Separator separator = new Separator();
    add(separator);
    return separator;
  }

  /**
   * Adds separator.
   *
   * @param index the separator index
   *
   * @return separator
   */
  public Separator addSeparator(int index) {
    Separator separator = new Separator();
    add(separator, index);
    return separator;
  }

// Overridden Methods. ---------------------------------------------------------

  /**
   * {@inheritDoc}
   */
  public void setLayout(LayoutManager layoutManager) {
    // empty method
  }

  /**
   * {@inheritDoc}
   */
  public void validate() {
    // empty method
  }

  /**
   * {@inheritDoc}
   */
  public void invalidate() {
    // empty method
  }

  /**
   * {@inheritDoc}
   */
  public void revalidate() {
    // empty method
  }

// Package-Private Native Methods. ---------------------------------------------

  native long _create();

  native void _insertChild(long delegate, long childDelegate, int index);

  native void _removeChild(long delegate, long childDelegate);

}
